package com.yuke.cloud.common.base.constant;

/**
 * The class Global constant.
 *
 * @author
 */
public class GlobalConstant {

	/**
	 * 秒杀活动分布式消息队列topic
	 */
	public static final String SEC_KILL_REDIS_TOPIC = "SecKill";

	/**
	 * 店铺消费兑换积分比率
	 */
	public static final Integer SHOP_POINT_RATE = 100;
	/**
	 * The constant FILE_MAX_SIZE.
	 */
	public static final long FILE_MAX_SIZE = 5 * 1024 * 1024;
	public static final String UNKNOWN = "unknown";

	public static final String X_FORWARDED_FOR = "X-Forwarded-For";
	public static final String X_REAL_IP = "X-Real-IP";
	public static final String PROXY_CLIENT_IP = "Proxy-Client-IP";
	public static final String WL_PROXY_CLIENT_IP = "WL-Proxy-Client-IP";
	public static final String HTTP_CLIENT_IP = "HTTP_CLIENT_IP";
	public static final String HTTP_X_FORWARDED_FOR = "HTTP_X_FORWARDED_FOR";


	public static final String LOCALHOST_IP = "127.0.0.1";
	public static final String LOCALHOST_IP_16 = "0:0:0:0:0:0:0:1";
	public static final int MAX_IP_LENGTH = 15;

	public static final String DEV_PROFILE = "dev";
	public static final String TEST_PROFILE = "test";
	public static final String PRO_PROFILE = "pro";
	public static final int TWO_INT = 2;
	public static final int M_SIZE = 1024;
	public static final String ROOT_PREFIX = "yuke";

	public static final int EXCEPTION_CAUSE_MAX_LENGTH = 2048;
	public static final int EXCEPTION_MESSAGE_MAX_LENGTH = 2048;

	public static final String ZK_REGISTRY_SERVICE_ROOT_PATH = "/yuke-cloud/registry/service";
	public static final String ZK_REGISTRY_ID_ROOT_PATH = "/yuke-cloud/registry/id";
	public static final String ZK_REGISTRY_PRODUCER_ROOT_PATH = "/yuke-cloud/registry/producer";
	public static final String ZK_REGISTRY_CONSUMER_ROOT_PATH = "/yuke-cloud/registry/consumer";
	public static final String ZK_REGISTRY_SEQ = "/yuke-cloud/seq";

	//mq消息类型
	public static final Byte MQ_TYPE_PRODUCER = 1;
	public static final Byte MQ_TYPE_CONSUMER = 2;


	public static final Long PMC_CATEGORY = 314341533145628672L;

	public interface Number {
		int THOUSAND_INT = 1000;
		int HUNDRED_INT = 100;
		int ONE_INT = 1;
		int TWO_INT = 2;
		int THREE_INT = 3;
		int FOUR_INT = 4;
		int FIVE_INT = 5;
		int SIX_INT = 6;
		int SEVEN_INT = 7;
		int EIGHT_INT = 8;
		int NINE_INT = 9;
		int TEN_INT = 10;
		int EIGHTEEN_INT = 18;
	}


	/**
	 * 系统常量
	 */
	public static final class Sys {

		private Sys() {
		}

		/**
		 * 系统预定义固定的角色
		 */
		/**
		 * 管理员角色
		 */
		public static final Long ADMIN_ROLE_ID = 1L;
		public static final String ADMIN_ROLE_CODE = "ROLE_ADMIN";

		/**
		 * 仓库中心管理员角色
		 */
		public static final Long WAREHOUSE_ADMIN_ROLE_ID = 2L;
		public static final String WAREHOUSE_ADMIN_ROLE_CODE = "ROLE_WAREHOUSE_ADMIN";

		/**
		 * 商品中心管理员角色  add by wg 20181120
		 */
		public static final Long PRODUCT_ADMIN_ROLE_ID = 3L;
		public static final String PRODUCT_ADMIN_ROLE_CODE = "ROLE_PRODUCT_ADMIN";

		/**
		 * 店铺中心管理员角色  add by wg 20181120
		 */
		public static final Long SHOP_ADMIN_ROLE_ID = 4L;
		public static final String SHOP_ADMIN_ROLE_CODE = "ROLE_SHOP_ADMIN";

		/**
		 * 仓库操作员角色 add by wg 20181120
		 */
		public static final Long WAREHOUSE_OPERATOR_ROLE_ID = 5L;
		public static final String WAREHOUSE_OPERATOR_ROLE_CODE = "ROLE_WAREHOUSE_OPERATOR";

		/**
		 * 普通用户（消费者）角色  add by wg 20181120
		 */
		public static final Long CONSUMER_ROLE_ID = 6L;
		public static final String CONSUMER_ROLE_CODE = "ROLE_CONSUMER";

		/**
		 * 商家用户角色  add by wg 20181120
		 */
		public static final Long SELLER_ROLE_ID = 7L;
		public static final String SELLER_ROLE_CODE = "ROLE_SELLER";

		/**
		 * 供应商用户角色  add by wg 20181120
		 */
		public static final Long SUPPLIER_ROLE_ID = 8L;
		public static final String SUPPLIER_ROLE_CODE = "ROLE_SUPPLIER";

		/**
		 * 运营中心管理员角色  add by wg 20190214
		 */
		public static final Long CONTENT_ADMIN_ROLE_ID = 9L;
		public static final String CONTENT_ADMIN_ROLE_CODE = "ROLE_CONTENT_ADMIN";

		/**
		 * 分公司管理员角色  add by wg 20190214
		 */
		public static final Long DEPARTMENT_ADMIN_ROLE_ID = 293445718977413120L;

		/**
		 * 送货司机
		 */
		public static final Long DEPARTMENT_DRIVER_ROLE_ID = 391301336693604352L;

		/**
		 * 业务员
		 */
		public static final Long DEPARTMENT_SALER_ROLE_ID = 391302698105962496L;

		/**
		 * 全局用户名
		 */
		public static final String TOKEN_AUTH_DTO = "CURRENT_USER_DTO";

		public static final String ROLE_DEPARTMENT_ADMIN = "GROUP_DTO";
		/**
		 * 超级管理员的用户ID
		 */
		public static final Long SUPER_MANAGER_USER_ID = 1L;
		/**
		 * 超级管理员的用户编号
		 */
		public static final String SUPER_MANAGER_LOGIN_NAME = "admin";
		/**
		 * 超级管理员角色ID
		 */
		public static final Long SUPER_MANAGER_ROLE_ID = 1L;
		/**
		 * 超级管理员组织ID
		 */
		public static final Long SUPER_MANAGER_GROUP_ID = 1L;
		/**
		 * 运营工作台ID
		 */
		public static final Long OPER_APPLICATION_ID = 1L;

		/**
		 * 组织ID预定义
		 */
		/**
		 * 公司ID
		 */
		public static final Long GROUP_COMPANY = 1L;
		/**
		 * 供应商ID
		 */
		public static final Long GROUP_SUPPLIER = 2L;
		/**
		 * 店铺ID
		 */
		public static final Long GROUP_SHOPPER = 3L;
		/**
		 * 顾客ID（暂不展示在树上）
		 */
		public static final Long GROUP_CUSTOMER = 4L;

		/**
		 * 用户类型
		 */
		public static final Integer USER_TYPE_CUSTOMER = 0;
		public static final Integer USER_TYPE_SHOPPER = 1;
		public static final Integer USER_TYPE_SUPPLIER = 2;
		public static final Integer USER_TYPE_COMPANY = 4;

		/**
		 * The constant MENU_ROOT.
		 */
		public static final String MENU_ROOT = "root";

		/**
		 * The constant DEFAULT_FILE_PATH.
		 */
		public static final String DEFAULT_FILE_PATH = "yuke-cloud/file/";

		/**
		 * redis key default expire = 1MINUTES
		 */
		public static final long REDIS_DEFAULT_EXPIRE = 1L;

		/**
		 * 全部请求类型
		 */
		public static final String ALL_REQUEST_TYPE = "ALL";
	}

	/**
	 * The class Symbol.
	 *
	 * @author
	 */
	public static final class Symbol {
		private Symbol() {
		}

		/**
		 * The constant COMMA.
		 */
		public static final String COMMA = ",";
		public static final String SPOT = ".";
		/**
		 * The constant UNDER_LINE.
		 */
		public final static String UNDER_LINE = "_";
		/**
		 * The constant PER_CENT.
		 */
		public final static String PER_CENT = "%";
		/**
		 * The constant AT.
		 */
		public final static String AT = "@";
		/**
		 * The constant PIPE.
		 */
		public final static String PIPE = "||";
		public final static String SHORT_LINE = "-";
		public final static String SPACE = " ";
		public static final String SLASH = "/";
		public static final String MH = ":";

	}

	/**
	 * The class Oss.
	 *
	 * @author
	 */
	public static final class Oss {
		private Oss() {
		}

		/**
		 * The constant DEFAULT_FILE_PATH.
		 */
		public static final String DEFAULT_FILE_PATH = "/default/";
	}


	/**
	 * 图片压缩高度和宽度
	 */
	public static final int IMAGE_WIDTH = 1920;
	/**
	 * The constant IMAGE_HEIGHT.
	 */
	public static final int IMAGE_HEIGHT = 1280;

	/**
	 * The constant Y.
	 */
	public static final Integer Y = 1;
	/**
	 * The constant N.
	 */
	public static final Integer N = 0;

	/**
	 * The enum Payment type enum.
	 *
	 * @author
	 */
	public enum PaymentTypeEnum {
		/**
		 * Online pay payment type enum.
		 */
		ONLINE_PAY(1, "在线支付");

		PaymentTypeEnum(int code, String value) {
			this.code = code;
			this.value = value;
		}

		private String value;
		private int code;

		/**
		 * Gets value.
		 *
		 * @return the value
		 */
		public String getValue() {
			return value;
		}

		/**
		 * Gets code.
		 *
		 * @return the code
		 */
		public int getCode() {
			return code;
		}

		/**
		 * Code of payment type enum.
		 *
		 * @param code the code
		 *
		 * @return the payment type enum
		 */
		public static PaymentTypeEnum codeOf(int code) {
			for (PaymentTypeEnum paymentTypeEnum : values()) {
				if (paymentTypeEnum.getCode() == code) {
					return paymentTypeEnum;
				}
			}
			return null;
		}

	}

	/**
	 * The enum Validate type enum.
	 *
	 * @author
	 */
	public enum ValidateTypeEnum {
		/**
		 * 短信验证类型
		 */
		IDENTITY_VER(1, "身份验证"), // 验证码${code}，您正在进行身份验证，打死不要告诉别人哦！
		LOGIN_CONFIRM(2, "登录确认"), // 验证码${code}，您正在登录，若非本人操作，请勿泄露。
		LOGIN_EXCEPTION(3, "登录异常"), // 验证码${code}，您正尝试异地登录，若非本人操作，请勿泄露。
		USER_REG(4, "用户注册"), // 验证码${code}，您正在注册成为新用户，感谢您的支持！
		PASSWORD_MOD(5, "修改密码"), // 验证码${code}，您正在尝试修改登录密码，请妥善保管账户信息。
		INFO_MOD(6, "信息变更"), // 验证码${code}，您正在尝试变更重要信息，请妥善保管账户信息。
		PASSWORD_GETBACK(7, "信息变更"), // 用户找回密码(短信内容:尊敬的用户，您的注册用户密码为：${code}，请勿泄漏于他人！为防止密码泄漏，请登录后立即修改密码！)
		APP_NEW_VERSION(8,"App更新"), //App更新
		APP_NEW_PRODUCT(9,"新产品上线"), //新产品上线
		APP_NEW_PROMOTE(10,"促销活动"); //促销活动


		ValidateTypeEnum(int code, String value) {
			this.code = code;
			this.value = value;
		}

		private String value;
		private int code;

		/**
		 * Gets value.
		 *
		 * @return the value
		 */
		public String getValue() {
			return value;
		}

		/**
		 * Gets code.
		 *
		 * @return the code
		 */
		public int getCode() {
			return code;
		}

		/**
		 * Code of validate type enum.
		 *
		 * @param code the code
		 *
		 * @return the payment type enum
		 */
		public static ValidateTypeEnum codeOf(int code) {
			for (ValidateTypeEnum validateTypeEnum : values()) {
				if (validateTypeEnum.getCode() == code) {
					return validateTypeEnum;
				}
			}
			return null;
		}

	}

	/**
	 * 系统常量
	 */
	public static final class SysInfo {

		private SysInfo() {
		}

		/**
		 * 系统
		 */

		public static final Integer SYS_INFO_REBATE = 2; //系统返利
		public static final Integer SYS_INFO_MONTHREBATE = 3;//月度累计满减
		public static final Integer SYS_INFO_DISCOUNT = 4; //系统打折
		public static final Integer SYS_INFO_DEDUCE = 5; //系统C端满减
		public static final Integer SYS_INFO_BUSINESS_DISCOUNT = 6; //云顶商人、云顶店铺C端消费打折
		public static final Integer SYS_INFO_ORDER_REBATE = 7; //客户C端订单就近绑定店铺，该店铺获得订单佣金提现率
		public static final Integer SYS_INFO_ORDER_COMMISSION = 8;//店家或云顶商人发展的客户C端订单，订单金额返利率
		public static final Integer SYS_INFO_POINT_SIGNIN = 9;//连续签到获得积分的增长率
		public static final Integer SYS_INFO_POINT_REBATE = 10;//积分折现率
		public static final Integer SYS_INFO_POINT_GO = 11;//积分换购
		public static final Integer SYS_INFO_POINT_MIX_GO = 12;//积分折现率
	}

	/**
	 * 系统常量
	 */
	public static final class CouponType {

		private CouponType() {
		}

		/**
		 * 系统
		 */


		public static final Integer COMMON_COUPON = 0; //普通优惠券
		public static final Integer WINE_COUPON = 1; //酒类优惠券
		public static final Integer EXPRESS_COUPON = 2; //包邮优惠券
		public static final Integer ORDER_COUPON = 3; //订单优惠券
		public static final Integer GOODS_COUPON = 4; //商品优惠券
		public static final Integer REGIST_COUPON = 5; //注册优惠券
		public static final Integer FIRST_COUPON = 6;//首单优惠券

	}
}
